<template>
  <div class="BeatsEP">
    <h1 class="title">
      <span>BeatsEP</span>
    </h1>

    <div v-for="(item,index) in newData" :key="index">
      <Swiper v-if='item.type=="swiperList"' :dataList="item.data"></Swiper>
    </div>

    <div class="container">
      <h1>Beats EP 贴耳式耳机让任何一位音乐爱好者都能享受到专业级调校的音质</h1>
      <ul>
        <li>
          <img src="@/assets/images/BeatsEP/content1.png">
          <h2>灵活贴合</h2>
          <span>可上下调节的滑杆，打造紧密贴合体验，让你享受极致舒适。</span>
        </li>
        <li>
          <img src="@/assets/images/BeatsEP/content2.png">
          <h2>轻便的设计</h2>
          <span>时尚、耐用的框架结构采用了轻质的不锈钢进行强化，佩戴非常方便。</span>
        </li>
        <li>
          <img src="@/assets/images/BeatsEP/content3.png">
          <h2>简单易用的控制按键</h2>
          <span>借助 RemoteTalk 内置麦克风和控制按键，可以接听电话、播放音乐、调整音量和启动语音。</span>
        </li>
        <li>
          <img src="@/assets/images/BeatsEP/content4.png">
          <h2>提升音质</h2>
          <span>它通过精湛的声学调制，营造了清澈、宽广的均衡音质。对于任何音乐爱好者而言，它都是理想的入门级 Beats 产品。</span>
        </li>
      </ul>

      <div class="box" @click="boxClick()">
        <h2>
          查看所有详情
          <img id="icon" src="https://www.beatsbydre.com.cn/content/dam/beats/web/common/icons/misc/png/circle-chevron.png.large.1x.png">
        </h2>

        <div class="message" v-show="!isActive">
          <div style="margin-top: 50px;">
            <h2>音质</h2>
            <ul>
              <li>
                <span>- 精湛的音质，带来清澈音色和深度音场，且有隔绝噪音效果</span>
              </li>
            </ul>
          </div>

          <div style="margin-top: 50px;">
            <h2>设计</h2>
            <ul>
              <li>
                <span>- 贴耳式耳机</span>
              </li>
              <li>
                <span>- 使用不锈钢强化，设计轻盈耐用</span>
              </li>
              <li>
                <span>- 可上下调节的滑杆，提供个人化的贴合体验</span>
              </li>
              <li>
                <span>- 高度：167 毫米/16.7 厘米</span>
              </li>
              <li>
                <span>- 重量：8 盎司/227 克</span>
              </li>
            </ul>
          </div>

          <div style="margin-top: 50px;">
            <h2>连接方式</h2>
            <ul>
              <li>
                <span>- 3.5 毫米音频接头</span>
              </li>
              <li>
                <span>- 兼容 Android</span>
              </li>
            </ul>
          </div>

          <div style="margin-top: 50px;">
            <h2>电源</h2>
            <ul>
              <li>
                <span>- 无电池设计，不间断播放</span>
              </li>
            </ul>
          </div>

          <div style="margin-top: 50px;">
            <h2>控制按钮</h2>
            <ul>
              <li>
                <span>- RemoteTalk 遥控线缆搭配线控麦克风和控制按键，可用来接听电话、播放音乐和启动 Siri</span>
              </li>
            </ul>
          </div>

          <div style="margin-top: 50px;">
            <h2>包装内容</h2>
            <ul>
              <li>
                <span>- Beats EP 头戴式耳机</span>
              </li>
              <li>
                <span>- 可折叠式便携袋</span>
              </li>
              <li>
                <span>- 快速入门指南</span>
              </li>
              <li>
                <span>- 保修卡</span>
              </li>
            </ul>
          </div>

        </div>

      </div>
    </div>

    <img src="https://www.beatsbydre.com.cn/content/dam/beats/web/product/headphones/ep/plp/bbd.plpassset.wired.beatsep.jpg.large.1x.jpg"
         style="width: 10rem; margin-top: 50px;">

    <div style="height: 100px;"></div>

  </div>
</template>

<script>
import Swiper from "@/components/home/Swiper";
import {api1} from "@/common/api/request";

export default {
  name: "BeatsEP",
  data(){
    return{
      newData:[],
      path:'/home/PowerBeats',
      isActive: true
    }
  },
  components:{
    Swiper
  },

  // activated() { //路由活跃时，添加上离开时的路径
  //   this.$router.push(this.path)
  // },
  // beforeRouteLeave(to,from,next){ //离开路由组件前
  //   this.path = this.$route.path  //记录此时路由路径
  //   next()
  // },


  created() {
    this.apiInit()
  },
  methods:{
    apiInit(){
      api1({
        url: '/api/index_list/7/data/1'
      }).then(res => {
        this.newData = res.data
        //console.log(res.data)
      })
    },
    boxClick(){
      this.isActive = !this.isActive
      if(!this.isActive){
        document.getElementById("icon").style.transform = "rotate("+180+"deg)";
      }
      else{
        document.getElementById("icon").style.transform = "rotate("+360+"deg)";
      }

    }
  }
}
</script>

<style scoped lang="scss">
.BeatsEP{
  position: relative;
  top: 92px;
  right: 0;
  left: 0;
}
.title{
  text-align: center;
  font-size: xxx-large;
}
.container{
  margin-top: 50px;
  text-align: left;
  width: 8rem;
  float: right;
  ul{
    display: flex;
    flex-wrap: wrap;
    li{
      margin-top: 30px;
      margin-left: 30px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-around;
      width: 500px;
      img{
        width: 90px;
        height: 90px;
      }
      span{
        font-size: 20px;
      }
    }
  }
  .box{
    width: 5rem;
    padding-top: 100px;
    img{
      width: 32px;
      height: 32px;
    }
  }
}
.message{
  ul{
    display: contents;
    li{
      width: 6.666667rem;
      text-align: left;
      align-items: start;
    }
  }
  span{
    font-size: 20px;
  }
}
</style>